//对外暴露配置路由(常量路由):全部用户都可以访问到的路由
export const constantRoute = [
    {
        //登录页面
        path: '/login',
        component: () => import('@/views/login/index.vue'),
        name: 'login',
        meta: {
            title: '登录', //菜单标题
            hidden: true, //代表路由标题在菜单中是否隐藏  true:隐藏 false:不隐藏
            icon: 'Promotion', //菜单文字左侧的图标,支持element-plus全部图标
        },
    },
    {
        //注册页面
        path: '/register',
        component: () => import('@/views/register/index.vue'),
        name: 'register',
        meta: {
            title: '注册',
            hidden: true,
            icon: 'Promotion',
        },
    },
    {
        //登录成功以后展示数据的路由
        path: '/',
        component: () => import('@/layout/index.vue'),
        name: 'layout',
        meta: {
            title: '首页',
            hidden: false,
            icon: '',
        },
        redirect: '/home',
        children: [
            {
                path: '/home',
                component: () => import('@/views/home/index.vue'),
                name: 'home',
                meta: {
                    title: '首页',
                    hidden: false,
                    icon: 'HomeFilled',
                },
            },
        ],
    },
    {
        path: '/sportsNews',
        component: () => import('@/layout/index.vue'),
        name: 'news',
        meta: {
            title: '体育新闻',
            icon: 'ChatDotSquare',
            hidden: false,
        },
        redirect: '/news/sportsNews',
        children: [
            {
                path: '/news/sportsNews',
                component: () => import('@/views/sportsNews/index.vue'),
                name: 'news',
                meta: {
                    title: '体育新闻',
                    icon: 'ChatDotSquare',
                    hidden: false,
                },
            },
        ]
    },
    {
        path: '/fitnesscenter',
        component: () => import('@/layout/index.vue'),
        name: 'fitnesscenter',
        meta: {
            title: '健身房介绍',
            icon: 'ChatDotSquare',
            hidden: false,
        },
        redirect: '/fitnesscenter/home',
        children: [
            {
                path: '/fitnesscenter/home',
                component: () => import('@/views/fitnesscenter/index.vue'),
                name: 'fitnesscenter',
                meta: {
                    title: '健身房介绍',
                    icon: 'ChatDotSquare',
                    hidden: false,
                },
            },
        ]
    },
    {
        path: '/trainers',
        component: () => import('@/layout/index.vue'),
        name: 'trainers',
        meta: {
            title: '教练',
            icon: 'ChatDotSquare',
            hidden: false,
        },
        redirect: '/trainers/home',
        children: [
            {
                path: '/trainers/home',
                component: () => import('@/views/trainers/index.vue'),
                name: 'trainers',
                meta: {
                    title: '教练',
                    icon: 'ChatDotSquare',
                    hidden: false,
                },
            },
        ]
    },
    {
        path: '/courses',
        component: () => import('@/layout/index.vue'),
        name: 'courses',
        meta: {
            title: '健身课程',
            icon: 'ChatDotSquare',
            hidden: false,
        },
        redirect: '/courses/home',
        children: [
            {
                path: '/courses/home',
                component: () => import('@/views/courses/index.vue'),
                name: 'courses',
                meta: {
                    title: '健身课程',
                    icon: 'ChatDotSquare',
                    hidden: false,
                },
            },
        ]
    },
    {
        path: '/forum',
        component: () => import('@/layout/index.vue'),
        name: 'forum',
        meta: {
            title: '论坛',
            icon: 'ChatDotSquare',
            hidden: false,
        },
        redirect: '/forum/home',
        children: [
            {
                path: '/forum/home',
                component: () => import('@/views/forum/index.vue'),
                name: 'forum',
                meta: {
                    title: '论坛',
                    icon: 'ChatDotSquare',
                    hidden: false,
                },
            },
        ]
    },
    {
        path: '/userInfo',
        component: () => import('@/layout/index.vue'),
        name: 'userInfo',
        meta: {
            title: '个人信息',
            icon: 'ChatDotSquare',
            hidden: false,
        },
        redirect: '/userInfo/home',
        children: [
            {
                path: '/userInfo/home',
                component: () => import('@/views/user/person.vue'),
                name: 'userInfo',
                meta: {
                    title: '个人信息',
                    icon: 'ChatDotSquare',
                    hidden: false,
                },
            },
        ]
    },
    {
        path: '/bookingsInfo',
        component: () => import('@/layout/index.vue'),
        name: 'bookingsInfo',
        meta: {
            title: '预约信息',
            icon: 'ChatDotSquare',
            hidden: false,
        },
        redirect: '/bookingsInfo/home',
        children: [
            {
                path: '/bookingsInfo/home',
                component: () => import('@/views/user/bookings.vue'),
                name: 'bookingsInfo',
                meta: {
                    title: '预约信息',
                    icon: 'ChatDotSquare',
                    hidden: false,
                },
            },
        ]
    },
    {
        path: '/coursesInfo',
        component: () => import('@/layout/index.vue'),
        name: 'coursesInfo',
        meta: {
            title: '课程信息',
            icon: 'ChatDotSquare',
            hidden: false,
        },
        redirect: '/coursesInfo/home',
        children: [
            {
                path: '/coursesInfo/home',
                component: () => import('@/views/user/courses.vue'),
                name: 'coursesInfo',
                meta: {
                    title: '课程信息',
                    icon: 'ChatDotSquare',
                    hidden: false,
                },
            },
        ]
    },
    {
        //404
        path: '/404',
        component: () => import('@/views/404/index.vue'),
        name: '404',
        meta: {
            title: '404',
            hidden: true,
            icon: 'DocumentDelete',
        },
    },
    {
        //任意路由
        path: '/:pathMatch(.*)*',
        redirect: '/404',
        name: 'Any',
        meta: {
            title: '任意路由',
            hidden: true,
            icon: 'DataLine',
        },
    }
]

